<admintpl file="header" />
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:U('Service/Adminindex/index')}" target="_self">服务商列表</a></li>
        <li><a href="{:U('Service/Adminindex/edit_sp', ['id' => $sp_id])}" target="_self">编辑服务商</a></li>
        <li class="active"><a href="">融资列表</a></li>
        <li><a href="{:U('Service/Adminindex/editsp_financing', ['sp_id' => $sp_id])}" target="_self">添加融资信息</a></li>
    </ul>
    <form class="js-ajax-form" action="" method="post">
        <table class="table table-hover table-bordered table-list">
            <thead>
                <tr>
                    <th width="50">ID</th>
                    <th>轮次</th>
                    <th>投资方</th>
                    <th>金额</th>
                    <th>日期</th>
                    <th>操作</th>
                </tr>
            </thead>
            <foreach name="lists" item="vo">
                <tr>
                    <td><b>{$vo.id}</b></td>
                    <td>{$vo.round}</td>
                    <td>{$vo.from}</td>
                    <td>{$vo.amount}</td>
                    <td>{$vo.time}</td>
                    <td>
                        <a href="{:U('Service/Adminindex/editsp_financing',array('id' => $vo['id'], 'sp_id' => $sp_id))}">{:L('EDIT')}</a> |
                        <a href="{:U('Service/Adminindex/editsp_financing',array('id' => $vo['id'], 'del' => 1))}" class="sp_delete" sp-id="{$vo.id}">{:L('DELETE')}</a>
                    </td>
                </tr>
            </foreach>
        </table>
    </form>
</div>
<script src="__PUBLIC__/js/common.js"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script>
<script>
    $(function () {
        $('.sp_delete').on('click', function (e) {
            e.preventDefault();
            var url = $(this).attr('href');
            layer.msg('确定删除？', {
                time: 0, //不自动关闭
                btn: ['确定', '取消'],
                yes: function(index){
                    layer.close(index);
                    $.get(url, function(re) {
                        if (re.status) {
                            window.location.reload();
                        }
                    })
                }
            });
        });
    })
</script>
</body>
</html>